package com.accesshollywood.indexables.items;

import java.util.Iterator;
import java.util.LinkedHashSet;

import com.accesshollywood.SQL.GFXSQL;
import com.accesshollywood.grfxOrdering.core.CoreFootageSet;
import com.accesshollywood.grfxOrdering.core.CoreStillSet;
import com.accesshollywood.indexables.AbstractIndexedSet;
import com.accesshollywood.indexables.Indexed;

public class FootageSet extends AbstractIndexedSet {
	protected LinkedHashSet<FootageIndexed>	set		= new LinkedHashSet<FootageIndexed>();
	protected String					path	= "";

	public FootageSet(){
		super();
		this.set = super.set;
	}
	
	@Override
	public void initSQL() {
		setThat(this);
		tableName = "footageList";
		idColumnName = "idFootageList";
		elementColumnName.put(getField("path"), "path");
		elementColumnName.put(getField("set"), "idFootage");
	}

	public synchronized LinkedHashSet<FootageIndexed> getSet() {
		return set;
	}

	public synchronized void setSet(LinkedHashSet<FootageIndexed> set) {
		this.set = set;
	}

	public synchronized String getPath() {
		return path;
	}

	public synchronized void setPath(String path) {
		this.path = path;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((path == null) ? 0 : path.hashCode());
		result = prime * result + ((set == null) ? 0 : set.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		FootageSet other = (FootageSet) obj;
		if (path == null) {
			if (other.path != null)
				return false;
		} else if (!path.equals(other.path))
			return false;
		if (set == null) {
			if (other.set != null)
				return false;
		} else if (!set.equals(other.set))
			return false;
		return true;
	}

}
